Ask AI
Skip to main content

Template placeholder

Values that are passed to a template by using Arguments/Parameters can be used to replace “Placeholders” used within any type of element. For example a Text element can contain a placeholder in the form of “{{TEST_VALUE}}”. This will result in the placeholder to be replaced by whatever value the “TEST_VALUE” parameter has.

Date Format

If you want to format a parameter of type DATE to a readable date on a page. You can use the “dateformat” function that will result in a date formatted like this: dd/MM/yyyy

Example: {{ MY_DATE | dateformat }} results in 26/03/1986

Datetime Format

If you want to format a parameter of type DATE to a readable datetime on a page. You can use the “datetimeformat” function that will result in a date formatted like this: dd/MM/yyyy HH:mm:ss

Example: {{ MY_DATE | dateformat }} results in 26/03/1986 12:51:24

JSON

If you want to format a parameter of type OBJECT to a readable json on a page. You can use the “json” function that will result in a formatted json string.

Example: {{ MY_OBJECT | json }} results in

{
“name”: “Tristan”,
”birthDate”: “26/03/1986”
}

Default Value

If you want to ensure that a placeholder displays a fallback value when the actual data is missing, empty, or undefined, you can use the default function. This is useful for keeping your templates clean and user-friendly, avoiding blank spaces or error messages when data is not available.

Usage:

{{ PLACEHOLDER | default: 'FALLBACK_VALUE' }}

When PLACEHOLDER has no value, the FALLBACK_VALUE will be used instead.

Examples:

{{ DATA.body.number | default: '0' }}

Result: If DATA.body.number is missing or empty, the output will be 0.

{{ DATA.body.string | default: ' ' }}

Result: If DATA.body.string is empty, a single space character will be displayed instead.


You can combine default with other formatting functions for better control over display values.

{{ DATA.body.date | dateformat: 'dd/MM/yyyy' }}

Formats a date into dd/MM/yyyy format.

{{ DATA.body.datetime | datetimeformat: 'dd/MM/yyyy HH:mm:ss' }}

Formats a datetime into dd/MM/yyyy HH:mm:ss format.

{{ DATA.body.number | numberformat }}

Formats a number according to locale rules.

{{ DATA.body.currency | currency }}

Formats a currency value using the system's default currency.

{{ DATA.body.currency | currency: {currency: 'EUR', minimumFractionDigits: 2, maximumFractionDigits: 4} }}

Formats a currency value explicitly in EUR with precision between 2 and 4 decimal places.